﻿Public Class formvnfull

    Private Sub btnvncfull_Click(sender As Object, e As EventArgs) Handles btnvncfull.Click
        ' Dim ruta As String
        '  Dim parametros As String
        Dim parametros2 As String


        ' parametros = "/user %username% /password" + passdomain
        parametros2 = textipvncfull.Text

        lbnerror.Text = ""
        If textipvncfull.Text = "" Then
            MsgBox("Please Insert IP Address", MsgBoxStyle.Exclamation)
            Return

        End If


        If My.Computer.Network.Ping(parametros2) Then

            Dim oProcess As New Process()
            Dim oStartInfo As New ProcessStartInfo("c:\program files\TechTools\vncviewer.exe", parametros2 & " " & "/user" & " " & globalvar.userdomain & " " & "/password" & " " & globalvar.passdomain)
            oStartInfo.UseShellExecute = False
            oStartInfo.RedirectStandardOutput = True
            oProcess.StartInfo = oStartInfo
            oProcess.Start()
            textipvncfull.Clear()

        Else

            lbnerror.Text = "IP Address is Shutdown or Incorrect "
            textipvncfull.Clear()
            Return

        End If




        Me.Close()


    End Sub

    Private Sub textipvncfull_TextChanged(sender As Object, e As EventArgs) Handles textipvncfull.TextChanged

    End Sub

    Private Sub ToolTip1_Popup(sender As Object, e As PopupEventArgs) Handles ToolTip1.Popup

    End Sub

    Private Sub formvnfull_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub btnclose_Click(sender As Object, e As EventArgs)
        Me.Close()

    End Sub
End Class